import os
from celery import Celery

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Tours.settings.dev")  # 设置项目的配置文件
app = Celery('Tours')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()

from datetime import timedelta
app.conf.beat_schedule={
    "add_every-30-seconds":{
        "task":'user.tasks.add',
        'schedule':timedelta(seconds=30),
        'args':(10,20)
    },
    'add-every-60-seconds':{
        'task':'user.tasks.send',
        'schedule':timedelta(seconds=120),
        'args':('1234','8888')
    }
}